package com.edu.mybatisplus.controller;

import com.edu.mybatisplus.bean.Employee;
import com.edu.mybatisplus.common.R;
import com.edu.mybatisplus.mapper.EmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class EmployeeController {
    @Autowired
    private EmployeeMapper employeeMapper;

    @GetMapping("/employees")
    public R<List<Employee>> getEmployees() {
        List<Employee> employees = employeeMapper.selectList(null);
        return R.success(employees);
    }
}
